<html>

<head>
   

	<script type="text/javascript" language="javascript">
	    // <![CDATA[
			window.onload = function() {
	        	new Effect.Appear('element_id');
				var s1 = new Control.Slider('handle1','track1', {axis:'horizontal', range: $R(1,8), values: [1,2,3,4,5,6,7,8]});
				
				s1.options.onChange = function(value){
                  if (value==1){value='Negotiable';}
                  if (value==2){value='Rs 0-1 lakh';}
                  if (value==3){value='Rs 1-2 lakhs';}
                  if (value==4){value='Rs 2-3 lakhs';}
                  if (value==5){value='Rs 3-5 lakhs';}
                  if (value==6){value='Rs 5-7 lakhs';}
                  if (value==7){value='Rs 7-9 lakhs';}
                  if (value==8){value='Rs 9 lakhs+';}

				        $('height_value_1').innerHTML = value;
				    };
				$('height_value_1').innerHTML = 'Negotiable';
				

			}
	    // ]]>
	  </script>

<title>Listings Page</title>
</head>

<body>
  <%require 'htmlentities'
  coder = HTMLEntities.new
  %>
<div class="listings-container">
	<div class="refine-search-results">
    	<div class="refine-search-by">
        	Refine Search by
        </div>
        
        <div class="refine-search-options">
         
           
         
          
          <%AdvertismentAttributeFieldValue.generate_list(@university.id,@category.id).each do |field_item, options| -%>
         
            <%@array=Category.find_by_stripped_name(params[:category]).form_labels-%>
            <%@array.each do |a|%>
             <%if a==(field_item)%>
                <div class="refine-search-category"><%=field_item.humanize -%></div>
                  <%options.each do |option_item,option_count| -%>
                    <div class="refine-search-filters">
                      <%if option_item.class == Array -%>
                        <%="#{option_item.inspect}" -%>
                      <%else%>
                            <%option_count["advertisments"].each do |advertisment_id|%>
                              <%@sub_category_id=Advertisment.find(advertisment_id).sub_category_id-%>
                             <%end -%>
                            <%=link_to "#{option_item.humanize} (#{option_count["count"]})", {:controller=>"listings", :action => "filtered_advertisments",:category=>Category.find_by_stripped_name(params[:category]).stripped_name,:university=>@university.stripped_name, :advertisments => option_count["advertisments"].compact.join("-"),:search_subcat=>@sub_category_id } -%>

                         <%end%>
                        </div>
                    <%end -%>
                 <%end -%>
              <%end -%>
          <%end -%>
          
        </div>
    </div>
    <div class="listings-center-column" id="listings-center-column">
        <div class="listings-search">
          
           <% form_tag url_for(:action => "search", :university=> params[:university], :category => params[:category])  do -%>
        	<div class="listings-search-title">
            	Find <%= h @category.name %>
            </div>
            <div class="search-field-one">
            	<div class="search-field-name">
                	Looking for
                </div>
                <div class="search-field-input">
                	 <%=select_tag "sub_category", options_for_select(SubCategory.find(:all,:conditions=>"category_id="+Category.find_by_stripped_name(params[:category]).id.to_s,:order=>"name").collect{|x| [x.name, x.stripped_name]}), :class => "search"-%>
                </div>
            </div>
            <div class="search-field-two">
            	<div class="search-field-name">
                	Keyword
                </div>
                <div class="search-field-input">
                	<input type="text" size="26" id="keyword" name="keyword" maxlength="40" class="input-boxes" value="IT, Developer, Finance etc."/>
                </div>
            </div>
            <div class="search-field-three">
            	<div class="search-field-name">
                	Locations
                </div>
                <div class="search-field-input">
                	<input type="text" size="26" id="location" name="location" maxlength="40" class="input-boxes" value="Delhi, Mumbai"/>
                </div>
            </div>
            <div class="listings-search-button">
    
            <%#= submit_tag(image_tag("listings-search.jpg",:width=>"75px",:height=>"20px",:border=>"0px")) %>
             <%= submit_tag "Search" %>
            </div>
            <%end -%>
    	</div>

        <div id="listings-search-results-cap">
    	<%= render :partial=>"advertisments" %>
        </div>

	</div>
    
    <div class="listings-right-column">
    	<div class="post-a-free-ad">
 	       Post a Free Ad
        </div>
    	<div class="subscribe-email">
 	       Subscribe Email
        </div>
        <div class="google-adsense">
          <%=image_tag("google-adsense.jpg",:width=>"150px",:height=>"562px",:border=>"0px") -%>
        
        </div>
    </div>
</div>
</body>
</html>
